package com.whcoding.designpatterns.pattern.decorator;

/**
 * @program: spring-boot-learning
 * @description: 抽象装饰角色:
 * @author: whcoding
 * @create: 2022-09-20 15:24
 **/
public class DecoratorVO extends DrinkAbstractVO {

	/**
	 * 使用聚合的方式
	 */
	private DrinkAbstractVO drink;


	public DecoratorVO(DrinkAbstractVO drink) {
		this.drink = drink;
	}

	@Override
	public float cost() {
		return super.getPrice() + drink.cost();
	}

	@Override
	public String getDesc() {
		return super.getDesc() + "&&" + drink.getDesc();
	}


}
